import {get, post, del, put} from "@/apis/http/request";
import {CodeGen, CodeGenConfig} from "@/apis/model/system/CodegenModel";

/**
 * 得到菜单列表
 * @param params
 */
export const getCodeGenList = (params: any) => get("/codeGen/list", params)

/**
 * 得到菜单分页列表
 * @param params
 */
export const codeGenPage = (params: any) => post("/codeGen/page", params)

/**
 * 删除数据
 * @param id
 * @returns
 */
export const deleteCodeGenById = (id: number) => del("/codeGen/delete/"+ id)

/**
 * 新增数据
 * @param param
 */
export const insertCodeGen = (param: CodeGen) => post("/codeGen", param)

/**
 * 生成代码
 * @param param
 */
export const createCodeGen = (param: CodeGen) => post("/codeGen/createCodeGen", param)

/**
 * 更新数据
 * @param param
 */
export const updateCodeGen = (param: CodeGen) => put("/codeGen", param)

/**
 * 得到全局配置信息
 * @param id
 */
export const getCodeGenConfigById = (id: number) => get("/codeGenConfig/" + id)

export const updateCodeGenConfig = (param: CodeGenConfig) => put("/codeGenConfig", param)